<?php

namespace app\api\controller;

use app\common\controller\Api;
use think\Db;

/**
 * 首页接口
 */
class Index extends Api
{
    protected $noNeedLogin = ['*'];
    protected $noNeedRight = ['*'];

    /**
     * 首页
     *
     */
    public function index()
    {
        //      [42]=> string(12) "销货订单" [48]=> string(9) "销货单" [61]=> string(15) "销货退货单" [67]=> string(21) "销售订单跟踪表" [68]=> string(18) "商品销售明细" [69]=> string(18) "销货开票管理" [72]=> string(21) "销货收款一览表" [73]=> string(26) "销售汇总表(按商品)" [74]=> string(26) "销售汇总表(按客户)" [75]=> string(29) "销售汇总表(按销售员)" [76]=> string(15) "销售利润表" [77]=> string(15) "销售排行表" [78]=> string(21) "往来单位欠款表" [83]=> string(6) "零售" [84]=> string(9) "零售单" [85]=> string(9) "收银台" [86]=> string(21) "收银台商品列表" [90]=> string(15) "零售退货单" [94]=> string(6) "生产" [95]=> string(9) "BOM清单" [98]=> string(12) "批量更新" [99]=> string(9) "BOM工序" [103]=> string(12) "生产计划" [108]=> string(18) "选择生产计划" [109]=> string(9) "MRP计算" [114]=> string(9) "生产单" [118]=> string(12) "选择列表" [120]=> string(12) "获取详情" [121]=> string(9) "领料单" [128]=> string(9) "退料单" [134]=> string(21) "获取生产单详情" [135]=> string(15) "委外加工单" [140]=> string(12) "选择详情" [142]=> string(9) "验收单" [148]=> string(12) "生产成本" [149]=> string(12) "计件工资" [150]=> string(12) "计时工资" [151]=> string(9) "调拨单" [155]=> string(18) "获取单位价格" [156]=> string(21) "获取可用序列号" [157]=> string(15) "成本调整单" [161]=> string(6) "盘点" [162]=> string(6) "导入" [165]=> string(6) "导出" [166]=> string(15) "序列号盘点" [171]=> string(15) "其他入库单" [178]=> string(15) "其他出库单" [183]=> string(9) "组装单" [187]=> string(12) "保存模板" [188]=> string(9) "拆卸单" [193]=> string(12) "库存预警" [194]=> string(21) "商品库存余额表" [195]=> string(15) "批次跟踪表" [196]=> string(21) "商品收发明细表" [197]=> string(21) "商品收发汇总表" [198]=> string(18) "序列号跟踪表" [199]=> string(18) "序列号状态表" [200]=> string(21) "批次保质期清单" [201]=> string(12) "模板列表" [202]=> string(12) "获取模板" [203]=> string(15) "拆卸单模板" [206]=> string(9) "付款单" [210]=> string(9) "收款单" [214]=> string(9) "核销单" [222]=> string(21) "应收账款明细表" [223]=> string(21) "应付账款明细表" [224]=> string(15) "其他收入单" [228]=> string(24) "采购销售费用清单" [229]=> string(24) "组合采购销售费用" [230]=> string(15) "其他支出单" [234]=> string(15) "资金转账单" [238]=> string(18) "现金银行报表" [239]=> string(15) "客户对账单" [240]=> string(18) "供应商对账单" [241]=> string(21) "其他收支明细表" [242]=> string(9) "利润表" [243]=> string(6) "资料" [244]=> string(18) "委外工厂管理" [248]=> string(12) "车间管理" [252]=> string(12) "客户列表" [257]=> string(15) "供应商管理" [262]=> string(12) "账户管理" [266]=> string(12) "商品管理" [284]=> string(12) "仓库管理" [289]=> string(12) "下拉列表" [290]=> string(12) "职员管理" [296]=> string(18) "自取地址管理" [299]=> string(12) "选择地址" [301]=> string(12) "司机管理" [305]=> string(12) "辅助资料" [306]=> string(12) "客户等级" [307]=> string(15) "供应商分类" [313]=> string(12) "客户分类" [318]=> string(12) "商品分类" [323]=> string(18) "支出类别管理" [328]=> string(18) "收入类别管理" [333]=> string(12) "结算方式" [338]=> string(12) "计量单位" [339]=> string(15) "单计量单位" [344]=> string(15) "多计量单位" [349]=> string(18) "商品辅助属性" [353]=> string(18) "客户物料编码" [354]=> string(6) "Import" [358]=> string(6) "设置" [359]=> string(12) "系统参数" [364]=> string(12) "状态切换" [365]=> string(15) "系统初始化" [366]=> string(9) "初始化" [367]=> string(16) "结账/反结账" [368]=> string(6) "结账" [369]=> string(9) "反结账" [370]=> string(18) "三方账号管理" [374]=> string(9) "订货通" [375]=> string(12) "轮播管理" [380]=> string(15) "订货单管理" [381]=> string(6) "发货" [383]=> string(12) "系统配置" [384]=> string(19) "查看/更新配置" [385]=> string(12) "用户管理" [388]=> string(18) "在线命令管理" [389]=> string(6) "详情" [390]=> string(21) "生成并执行命令" [391]=> string(18) "再次执行命令" }
        $yingyu = [
            '编辑' => 'Edit',
            '删除' => 'Delete',
            '审核/反审核' => 'Audit/Anti-audit',
            '内置函数' => 'Built-in function',
            '购货单' => 'Purchase order',
            '对单/反对单' => 'Order/against order',
            '购货退货单' => 'Returned purchase',
            '采购明细表' => 'Purchase details',
            '采购订单跟踪表' => 'Purchase order tracking table',
            '采购汇总表(商品)' => 'Purchase summary (commodity)',
            '采购汇总表(供应商)' => 'Purchase summary (supplier)',
            '采购汇总表(仓库)' => 'Purchase summary (warehouse)',
            '采购汇总表(资金)' => 'Purchase summary (fund)',
            '采购汇总表(审核)' => 'Purchase summary (audit)',
            '采购汇总表(反审核)' => 'Purchase summary (anti-audit)',
            '查询' => 'Query',
            '采购付款一览表' => 'Purchase payment overview table',
            '采购开票管理' => 'Purchase invoice management',
            '开票单' => 'Invoice',
            '以销定购看板' => 'Purchase to order',
            '智能补货' => 'Smart replenishment',
            '原始单据' => 'Original document',
            '选择' => 'Select',

            '内置函数' => 'Built-in function',
            '购货单' => 'Purchase order',
            '对单/反对单' => 'Order/against order',
            '购货退货单' => 'Returned purchase',
            '采购明细表' => 'Purchase details',
            '采购订单跟踪表' => 'Purchase order tracking table',
            '采购汇总表(商品)' => 'Purchase summary (by commodity)',
            '采购汇总表(供应商)' => 'Purchase summary (by supplier)',
            '采购付款一览表' => 'Purchase payment list',
            '采购开票管理' => 'Purchase invoicing management',
            '以销定购看板' => 'Purchase based on sales kanban',
            '智能补货' => 'Intelligent replenishment',
            '原始单据' => 'Original documents',
            '销货订单' => 'Sales order',
            '销货单' => 'Sales bill',
            '销货退货单' => 'Sales return bill',
            '销售订单跟踪表' => 'Sales order tracking table',
            '商品销售明细' => 'Commodity sales details',
            '销货开票管理' => 'Sales invoicing management',
            '销货收款一览表' => 'Sales collection list',
            '销售汇总表(按商品)' => 'Sales summary (by commodity)',
            '销售汇总表(按客户)' => 'Sales summary (by customer)',
            '销售汇总表(按销售员)' => 'Sales summary (by salesperson)',
            '销售利润表' => 'Sales profit statement',
            '销售排行表' => 'Sales ranking list',
            '往来单位欠款表' => 'Outstanding payments of business partners',
            '零售' => 'Retail',
            '零售单' => 'Retail bill',
            '收银台' => 'Cashier desk',
            '收银台商品列表' => 'Cashier desk commodity list',
            '零售退货单' => 'Retail return bill',
            '生产' => 'Production',
            'BOM清单' => 'Bill of materials list',
            'BOM工序' => 'Bill of materials process',
            '生产计划' => 'Production plan',
            'MRP计算' => 'Material requirements planning calculation',
            '生产单' => 'Production order',
            '领料单' => 'Material requisition bill',
            '退料单' => 'Material return bill',
            '委外加工单' => 'Outsourced processing order',
            '验收单' => 'Acceptance bill',
            '生产成本' => 'Production cost',
            '计件工资' => 'Piecework wage',
            '计时工资' => 'Hourly wage',
            '仓库' => 'Warehouse',
            '调拨单' => 'Transfer order',
            '成本调整单' => 'Cost adjustment bill',
            '盘点' => 'Inventory check',
            '序列号盘点' => 'Serial number inventory check',
            '其他入库单' => 'Other warehouse receipt bill',
            '其他出库单' => 'Other warehouse issue bill',
            '组装单' => 'Assembly bill',
            '拆卸单' => 'Disassembly bill',
            '库存预警' => 'Inventory warning',
            '商品库存余额表' => 'Commodity inventory balance sheet',
            '批次跟踪表' => 'Batch tracking table',
            '商品收发明细表' => 'Commodity receipt and issue details',
            '商品收发汇总表' => 'Commodity receipt and issue summary',
            '序列号跟踪表' => 'Serial number tracking table',
            '序列号状态表' => 'Serial number status table',
            '批次保质期清单' => 'Batch shelf life list',
            '模板列表' => 'Template list',
            '获取模板' => 'Get template',
            '拆卸单模板' => 'Disassembly bill template',
            '资金' => 'Funds',
            '付款单' => 'Payment bill',
            '收款单' => 'Collection bill',
            '核销单' => 'Write-off bill',
            '应收账款明细表' => 'Accounts receivable details',
            '应付账款明细表' => 'Accounts payable details',
            '其他收入单' => 'Other income bill',
            '采购销售费用清单' => 'Purchase and sales expense list',
            '组合采购销售费用' => 'Combined purchase and sales expense',
            '其他支出单' => 'Other expense bill',
            '资金转账单' => 'Funds transfer bill',

            '开票' => 'Invoicing',
            '批量更新' => 'Batch update',
            '选择生产计划' => 'Select production plan',
            '选择列表' => 'Selection list',
            '获取详情' => 'Get details',
            '获取生产单详情' => 'Get production order details',
            '选择详情' => 'Select details',
            '获取单位价格' => 'Get unit price',
            '获取可用序列号' => 'Get available serial number',
            '导入' => 'Import',
            '导出' => 'Export',
            '保存模板' => 'Save template',
            '现金银行报表' => 'Cash and bank statement',
            '客户对账单' => 'Customer statement',
            '供应商对账单' => 'Supplier statement',
            '其他收支明细表' => 'Other revenue and expense details',
            '利润表' => 'Profit statement',
            '资料' => 'Materials',
            '委外工厂管理' => 'Outsourced factory management',
            '车间管理' => 'Workshop management',
            '客户列表' => 'Customer list',
            '供应商管理' => 'Supplier management',
            '账户管理' => 'Account management',
            '商品管理' => 'Commodity management',
            '仓库管理' => 'Warehouse management',
            '下拉列表' => 'Drop-down list',
            '职员管理' => 'Staff management',
            '自取地址管理' => 'Self-collection address management',
            '选择地址' => 'Select address',
            '司机管理' => 'Driver management',
            '辅助资料' => 'Auxiliary materials',
            '客户等级' => 'Customer level',
            '供应商分类' => 'Supplier classification',
            '客户分类' => 'Customer classification',
            '商品分类' => 'Commodity classification',
            '支出类别管理' => 'Expense category management',
            '收入类别管理' => 'Income category management',
            '结算方式' => 'Settlement method',
            '计量单位' => 'Unit of measurement',
            '单计量单位' => 'Single unit of measurement',
            '多计量单位' => 'Multiple units of measurement',
            '商品辅助属性' => 'Commodity auxiliary attributes',
            '客户物料编码' => 'Customer material coding',
            'Import' => '导入（保留英文，可能是特定功能或术语）',
            '设置' => 'Settings',
            '系统参数' => 'System parameters',
            '状态切换' => 'Status switching',
            '系统初始化' => 'System initialization',
            '初始化' => 'Initialization',
            '结账/反结账' => 'Checkout/Reverse checkout',
            '结账' => 'Checkout',
            '反结账' => 'Reverse checkout',
            '三方账号管理' => 'Three-party account management',
            '订货通' => 'Ordering system',
            '轮播管理' => 'Carousel management',
            '订货单管理' => 'Order management',
            '发货' => 'Delivery',
            '系统配置' => 'System configuration',
            '查看/更新配置' => 'View/Update configuration',
            '用户管理' => 'User management',
            '在线命令管理' => 'Online command management',
            '详情' => 'Details',
            '生成并执行命令' => 'Generate and execute command',
            '再次执行命令' => 'Execute command again',



            'ERP管理' => 'ERP management',
            // ERP管理数据面板
            '购货统计' => 'Purchase statistics',
            '销货统计' => 'Sales statistics',
            '库存统计' => 'Inventory statistics',
            '欠款统计' => 'Debt statistics',
            '购货总量(本月)' => 'Total purchases (this month)',
            '购货金额(本月)' => 'Purchase amount (this month)',
            '销货总量(本月)' => 'Total sales volume (this month)',
            '销货金额(本月)' => 'Sales amount (this month)',
            '库存总量' => 'Total inventory',
            '库存成本' => 'inventory cost',
            '客户欠款' => 'Customer debt',
            '供应商欠款' => 'Supplier arrears',
            '购货' => 'purchases',
            '销货' => 'sales',
            '仓库' => 'warehouse',
            '资金' => 'fund',
            '审核' => 'Process',
            '反审核' => 'Anti Audit',
            '打印' => 'Print',
            '请选择' => 'Please Select',
            '商品' => 'Commodity',
            '批次' => 'Batch',
            '生产日期' => 'Date Of Manufacture',
            '保质期(天)' => 'Shelf Life (days)',
            '有效期至' => 'Valid Until',
            '生产数量' => 'Production Quantity',
            '数据面板' => 'Data Panel',
            '查看' => 'View',
            '数据大屏' => 'Data Screen',
            '数据报表' => 'Data Report',
            '数据统计' => 'Data Statistics',
            '购货订单' => 'Purchase order',
            '添加' => 'Add',
        ];



        $list =   Db::name('auth_rule')->where('id', '>', 84)->select();
        //循环把title翻译英语然后更新
        $arr = [];
        foreach ($list as $k => $v) {
          

            Db::name('auth_rule')->where('id',$v['id'])->update(['title'=>$yingyu[$v['title']]]);
        }
        //   数组去重
     
        $this->success('请求成功');
    }
}
